package com.shelpe.services.keywords.entity.jpa;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.shelpe.services.keywords.service.utils.EntityUtils.OnlineStatusConverter;
import lombok.Data;

@Entity(name = "adgroups")
@Data
public class Adgroup {

	@Id
	@Column(name = "adgroup_id")
	@JsonProperty("adgroup_id")
	private long autoID;
	@Column(name = "user_id")
	@JsonIgnore
	private long userID;
	@Column(name = "campaign_id")
	@JsonProperty("campaign_id")
	private long campaignID;

	@Convert(converter = OnlineStatusConverter.class)
	@JsonProperty("online_status")
	private OnlineStatus onlineStatus;
	@Convert(converter = OnlineStatusConverter.class)
	@JsonProperty("offline_type")
	private OnlineStatus offlineType;
	@JsonProperty("mobile_discount")
	private int mobileDiscount = 100;
	
	@JsonProperty("modified_time")
	private Date modifiedTime;
	@JsonProperty("create_time")
	private Date createTime;
	@JsonIgnore
	@Temporal(TemporalType.DATE)
	private Date updatedTime;
	@Column(name = "drive_type")
	private int driveType;
	private Date maintainedDate;
}
